package com.android.scanner.utils;

import com.android.scanner.R;

public class StatusUtil {

	private int[] battery = { R.drawable.dianchi1, R.drawable.dianchi2,
			R.drawable.dianchi3, R.drawable.dianchi4, R.drawable.dianchi5 };
	private int[] wifi = { R.drawable.wifi1, R.drawable.wifi2,
			R.drawable.wifi3, R.drawable.wifi4 };
	private int[] gsm = { R.drawable.shoujixinhao1, R.drawable.shoujixinhao2,
			R.drawable.shoujixinhao3, R.drawable.shoujixinhao4,
			R.drawable.shoujixinhao5 };

	public static int getBatteryStatus(int percent) {
		int d = R.drawable.dianchi5;
		if (percent < 80 && percent >= 60) {
			d = R.drawable.dianchi4;
		} else if (percent < 60 && percent >= 40) {
			d = R.drawable.dianchi3;
		} else if (percent < 40 && percent >= 20) {
			d = R.drawable.dianchi2;
		} else if (percent < 20) {
			d = R.drawable.dianchi1;
		}
		return d;
	}
	
	public static int getGSMStatus(int data) {
		int d = R.drawable.shoujixinhao1;
		if (data < -60 && data >= -80) {
			d = R.drawable.shoujixinhao2;
		} else if (data < -40 && data >= -60) {
			d = R.drawable.shoujixinhao3;
		} else if (data < -20 && data >= -40) {
			d = R.drawable.shoujixinhao4;
		} else if (data >= -20) {
			d = R.drawable.shoujixinhao5;
		}
		return d;
	}
}
